<template>
    <div>
        <h2>添加等级</h2>
        <p>等级名称：<input type="text" v-model="grade"></p>
        <p><input type="button" value="添加" @click="addgrade"></p>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    data() {
        return {
            grade:''
        }
    },
    methods:{
        addgrade(){
            let form_date = new FormData()
            form_date.append("grade",this.grade)
            axios({
                url:"http://127.0.0.1:8000/app01/gradeapi/",
                method:"post",
                data:form_date
            }).then(res=>{
                console.log(res)
            })
        }
    },
    created() {

    }
}
</script>